/*
author:杨文超
email:yangwenchao@keynection.cn
*/
#include "esp_err.h"                // for esp_err_t
#include "mbc_master.h"             // for master interface define
#include "geminai_modbus_master.h"      // for public slave defines
#include "mbc_serial_master.h"      // for public interface defines

/*
Initialization of Modbus master serial
*/
esp_err_t mbc_master_init(void** handler)
{
    void* port_handler = NULL;
    esp_err_t error = mbc_serial_master_create(&port_handler);


    if ((port_handler != NULL) && (error == ESP_OK)) {
        mbc_master_init_iface(port_handler);
        *handler = port_handler;
    }
    return error;
}